textlayout: Use gtk_snapshot_{push,pop}_collect()
authorTimm Bäder <mail@baedert.org>
Fri, 31 Jan 2020 16:43:31 +0000 (17:43 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 7 Feb 2020 18:16:32 +0000 (13:16 -0500)
gtk/gtktextlayout.c

index 5a2b4197306b29e35cd62cd3e7eaf0dcd653ea0c..a5b2d8fe08111d82d89e8ca7369a03982b36dff5 100644 (file)
@@ -4160,15 +4160,13 @@ gtk_text_layout_snapshot (GtkTextLayout      *layout,
 
           if (line_display->node == NULL)
             {
-              GtkSnapshot *sub = gtk_snapshot_new_with_parent (snapshot);
+              gtk_snapshot_push_collect (snapshot);
 
-              crenderer->snapshot = sub;
               render_para (crenderer, 0, line_display,
                            selection_start_index, selection_end_index,
                            cursor_alpha);
-              crenderer->snapshot = snapshot;
 
-              line_display->node = gtk_snapshot_free_to_node (sub);
+              line_display->node = gtk_snapshot_pop_collect (snapshot);
             }
 
           if (line_display->node != NULL)